package com.ln.yygh.hosp.controller;

import com.ln.yygh.common.result.Result;
import com.ln.yygh.hosp.service.DepartmentService;
import com.ln.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: lianXiaoChen
 * @create: 2021-06-02 20:59
 */
@RestController//表示controller全部都是ajax请求
@RequestMapping("/admin/hosp/department")//路径
@Api(tags = "查询树型信息")//前端注解
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;
    //根据医院编号查询普通医院科室列表
    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode) {
        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
        return Result.ok(list);
    }

}
